<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>动画</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }
        
        #head01 {
            position: absolute;
            z-index: 20;
        }
        
        #head02 {
            position: absolute;
            top: 0px;
            left: 0px;
            z-index: 10;
        }
        
        #head01:hover+#head02 {
            transition: 0.2s;
            position: absolute;
            top: 437px;
        }
    </style>
</head>

<body>
    <img id="head01" src="./img/head.jpg" alt="">
    <img id="head02" src="./img/head.jpg" alt="">
</body>

</html>